//引入less文件
require("../less/advertisement.less")

document.ready(function(){
let countDown = document.querySelector("#countDown")
let countDownNum = document.querySelector("#countDownNum")

//计时器
let num = 5;
countDownNum.textContent=num;
let timerId = window.setInterval(function(){
    num=num-1;
    //判断
    if(num === 0){
         //清除定时器
        window.clearInterval(timerId);
         //实现页面跳转
         window.location.href = "./register.html"
    }else{
        countDownNum.textContent=num;
    }
    console.log(num);
},1000)
    //跳过按钮
    countDown.addEventListener("click",function(){
        //清除定时器
        window.clearInterval(timerId);
        //跳转路径
        window.location.href = "./register.html"
    })

})